import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsOptional, IsNumber, IsDateString, Min, Max, MaxLength } from 'class-validator';
import { Type } from 'class-transformer';
import { CommonStatus } from '~/common/entity/common.entity';

export class UpdateCatalogDto {
  @ApiProperty({ description: '目录ID', example: 1 })
  @IsNumber({}, { message: 'ID必须是数字' })
  @Type(() => Number)
  id: number;

  @ApiProperty({ description: '目录名称', example: '健康知识' })
  @IsString()
  @MaxLength(50, { message: '目录名称不能超过50个字符' })
  name: string;

  @ApiPropertyOptional({ description: '目录编码', example: 'health_knowledge' })
  @IsOptional()
  @IsString()
  @MaxLength(100, { message: '目录编码不能超过100个字符' })
  code?: string;

  @ApiPropertyOptional({ description: '目录描述', example: '健康知识相关内容' })
  @IsOptional()
  @IsString()
  @MaxLength(200, { message: '目录描述不能超过200个字符' })
  description?: string;

  @ApiPropertyOptional({
    description: '推送开始时间',
    example: '2024-01-01',
    format: 'date'
  })
  @IsOptional()
  pushStartTime?: string;

  @ApiPropertyOptional({
    description: '推送结束时间',
    example: '2024-12-31',
    format: 'date'
  })
  @IsOptional()
  pushEndTime?: string;
}